package com.macro.mall.model;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * hc_handle_convention实体类
 *
 * @author gaodx
 *
 */
@Data
@Builder
@AllArgsConstructor
@ApiModel(description = "居委会办事预约请求报文",value = "居委会办事预约请求报文")
public class HcHandleConvention implements Serializable{
	/***/
    @ApiModelProperty(value = "")
	private Integer id; 
	/**用户id*/
    @ApiModelProperty(value = "用户id")
	private Integer userId; 
	/**姓名*/
    @ApiModelProperty(value = "姓名")
	private String userName; 
	/**手机号*/
    @ApiModelProperty(value = "手机号")
	private String mobile; 
	/**办理指南id*/
    @ApiModelProperty(value = "办理指南id")
	private Integer handleId;
    @ApiModelProperty(value = "社区名称")
	private String communityName;
    @ApiModelProperty(value = "楼号")
	private String floor;
    /**预约办理时间*/
    @ApiModelProperty(value = "预约办理时间")
    private String handleDate;
    /**预约办理时间*/
    @ApiModelProperty(value = "预约办理时间段")
    private String handleTime;
	/**预约申请时间*/
    @ApiModelProperty(value = "预约申请时间")
	private Date createTime; 
	/**修改时间*/
    @ApiModelProperty(value = "修改时间")
	private Date updateTime; 
	/**
	 * 实例化
	 */
	public HcHandleConvention() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public HcHandleConvention(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).intValue());
		}
		if (obj.get("userId") instanceof Number) {
			this.setUserId(((Number) obj.get("userId")).intValue());
		}
		if (obj.get("userName") instanceof String) {
			this.setUserName((String) obj.get("userName"));
		}
		if (obj.get("mobile") instanceof String) {
			this.setMobile((String) obj.get("mobile"));
		}
		if (obj.get("handleId") instanceof Number) {
			this.setHandleId(((Number) obj.get("handleId")).intValue());
		}
		this.setCreateTime((Date) obj.get("createTime"));
		this.setUpdateTime((Date) obj.get("updateTime"));
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getUserId() != null) {
			result.put("userId",this.getUserId());
		}
		if (this.getUserName() != null) {
			result.put("userName",this.getUserName());
		}
		if (this.getMobile() != null) {
			result.put("mobile",this.getMobile());
		}
		if (this.getHandleId() != null) {
			result.put("handleId",this.getHandleId());
		}
		if (this.getHandleTime() != null) {
			result.put("handleTime",this.getHandleTime());
		}
		if (this.getCreateTime() != null) {
			result.put("createTime",this.getCreateTime());
		}
		if (this.getUpdateTime() != null) {
			result.put("updateTime",this.getUpdateTime());
		}
		return result;
	}


	@Override
	public String toString() {
		return "HcHandleConvention [id=" + id + " , userId=" + userId + " , userName=" + userName + " , mobile=" + mobile + " , handleId=" + handleId + " , handleTime=" + handleTime + " , createTime=" + createTime + " , updateTime=" + updateTime + "  ]";
	
	}
	
	
}
